﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using sexhealth.console.service.post.vo;
using sexhealth.console.service.post;

public partial class usercontrol_LeftChannelImage : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) 
        {
            if (Request["chid"] != null) 
            {
                PostService postService=new PostService();
                ChannelVO channel = postService.DaoGetVOById<ChannelVO>(int.Parse(Request["chid"]));
                ChannelVO parentChannel = postService.DaoGetVOById<ChannelVO>(channel.ParentId);
                if (parentChannel != null)
                {
                    imgChannel.ImageUrl = parentChannel.LeftTitlePicPath;
                }
                else 
                {
                    imgChannel.ImageUrl = channel.LeftTitlePicPath;
                }
              
            }
        }
    }
}
